import {NgModule} from '@angular/core';
import {Route, RouterModule, Routes} from '@angular/router';
import {EveryDataRootComponent} from "./root.component";

const coreRoutes: Route = {
  path: 'everydata',
  component: EveryDataRootComponent,
  children: [
    {
      path: 'form',
      loadChildren: () => import('./form/form.module').then(m => m.FormModule)
    },
    {
      path: 'table',
      loadChildren: () => import('./table/table.module').then(m => m.TableModule)
    },
    {
      path: 'category',
      loadChildren: () => import('./category/category.module').then(m => m.CategoryModule)
    },
    {
      path: 'edit',
      loadChildren: () => import('./edit/edit.module').then(m => m.EditModule)
    },
    {
      path: 'list',
      loadChildren: () => import('./list/list.module').then(m => m.ListModule)
    }
  ]
}

const routes: Routes = [
  coreRoutes,
  {
    path: 'center',
    component: EveryDataRootComponent,
    children: [coreRoutes]
  },
  {
    path: 'blank',
    component: EveryDataRootComponent,
    children: [coreRoutes]
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})

export class AppRoutingModule {
}
